<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script language="JavaScript">
function point_it(event){
	pos_x = event.offsetX?(event.offsetX):event.pageX-document.getElementById("pointer_div").offsetLeft;
	pos_y = event.offsetY?(event.offsetY):event.pageY-document.getElementById("pointer_div").offsetTop;
	document.getElementById("cross").style.left = (pos_x-1) ;
	document.getElementById("cross").style.top = (pos_y-15) ;
	document.getElementById("cross").style.visibility = "visible" ;
	document.pointform.form_x.value = pos_x;
	document.pointform.form_y.value = pos_y;
	document.pointform.form_lo.value = viTriLo(pos_x, pos_y);
}
function storeCoordinate(x1Val, y1Val, x2Val, y2Val, vtVal, array) {
    array.push({x1: x1Val, 
				y1: y1Val, 
				x2: x2Val,
				y2: y2Val,
				vt: vtVal});
	return array;
}
function InitVT()
{
	storeCoordinate(0, 0, 47, 57, 'LK-1-CV', arrStart);
	storeCoordinate(48, 0, 64, 57, 'LK-1-3', arrStart);
	storeCoordinate(65, 0, 97, 57, 'LK-1-4', arrStart);
	
	//return arrStart;
}
var arrStart = new Array();

function viTriLo(x, y)
{	
	
	InitVT();
	flag = false;
	value = '';
	
	for (var i = 0; i < arrStart.length; i++) {
		if( (x > arrStart[i].x1 && x < arrStart[i].x2) && (y > arrStart[i].y1 && y < arrStart[i].y2))
		{
			value = arrStart[i].vt;		
			flag = true;
		}
	} 
	
	if(flag)
		return value;
	else
		return 'Unknown';
	
}
</script>
</head>
<body>

<div style="width:400px; height:200px; float:left; background:#009966;">
test abc
</div>
<form name="pointform" method="post">
<div id="pointer_div" onclick="point_it(event)" style = "background-image:url('images/LK-1.png');width:98px;height:455px; float:left;">
<img src="point.gif" id="cross" style="position:relative;visibility:hidden;z-index:2;"></div>
INDEX: [x] = <input type="text" name="form_x" size="4" /> - [y] = <input type="text" name="form_y" size="4" /> - [Lo]: <input type="text" name="form_lo" size="10" />
</form>
</body>
</html>